package com.mc;

import org.junit.Test;

public class test {
    @Test
    public void test1() {
        String s = "-5";
        String[] strings = s.split("-");
        System.out.println(strings.length);
        System.out.println(strings);
        System.out.println(strings.toString());
        System.out.println(strings[0]);
        System.out.println(strings[0].toString());
        System.out.println(strings[1]);
        String s3 = strings[1];

        if(strings[0].equals("")){
            String s2 =strings[0];
            System.out.println(236);
            System.out.println(s2.length());
            s3="56";

        }
        System.out.println(s3);
    }

    @Test
    public void test2() {
        String s = "-";
        String[] strings = s.split("-");
        System.out.println(strings.length);
    }

    @Test
    public void test3() {
        String s = "5-";
        String[] strings = s.split("-");
        System.out.println(strings.length);
        System.out.println(strings[0]);
        System.out.println("----------------");

        String s2 = "-5";
        String[] strings2 = s2.split("-");
        System.out.println(strings2.length);  //2
        System.out.println(strings2[0]);
        System.out.println(strings2[1]);
    }

}
